home *** CD-ROM | disk | FTP | other *** search
/ Maclife 157 / MACLIFE157-2001-09.ISO.7z / MACLIFE157-2001-09.ISO / Linux / MacOS Tools / Other / BootX 1.1.3 (for Old Mac OS) / Sources / src / DeviceTree.h < prev    next >
Text File  |  2001-07-23  |  2KB  |  73 lines

  1. #ifndef __DEVICETREE_H__
  2. #define __DEVICETREE_H__
  3.  
  4. #include <NameRegistry.h>
  5.  
  6. /* Structures that defines our copy of the Name Registry. This maps
  7.    exactly linux internal representation of the tree
  8.  */
  9.  
  10. /* All this requires PowerPC alignement */
  11. #pragma options align=power
  12.  
  13. typedef void *phandle;
  14. typedef void *ihandle;
  15.  
  16. struct address_range {
  17.     unsigned int space;
  18.     unsigned int address;
  19.     unsigned int size;
  20. };
  21.  
  22. struct interrupt_info {
  23.     int    line;
  24.     int    sense;        /* +ve/-ve logic, edge or level, etc. */
  25. };
  26.  
  27. struct reg_property {
  28.     unsigned int address;
  29.     unsigned int size;
  30. };
  31.  
  32. struct translation_property {
  33.     unsigned int virt;
  34.     unsigned int size;
  35.     unsigned int phys;
  36.     unsigned int flags;
  37. };
  38.  
  39. struct property {
  40.     char    *name;
  41.     int    length;
  42.     unsigned char *value;
  43.     struct property *next;
  44. };
  45.  
  46. struct device_node
  47. {
  48.     char    *name;                    // To be remapped
  49.     char    *type;                    // To be remapped
  50.     phandle    node;                    // Nothing interesting here
  51.     int    n_addrs;                    // Not initialised here
  52.     struct    address_range *addrs;    // Not initialised here
  53.     int    n_intrs;                    // Not initialised here
  54.     struct    interrupt_info *intrs;    // Not initialised here
  55.     char    *full_name;                // To be remapped
  56.     struct    property *properties;    // To be remapped
  57.     struct    device_node *parent;    // To be remapped
  58.     struct    device_node *child;        // To be remapped
  59.     struct    device_node *sibling;    // To be remapped
  60.     struct    device_node *next;        // To be remapped (next device of same type)
  61.     struct    device_node *allnext;    // To be remapped (next in list of all nodes)
  62. };
  63.  
  64. // Prototypes of exported functions
  65. extern OSStatus            copy_device_tree(Ptr where, unsigned long *size, unsigned long *outMainDispOffset);
  66.  
  67. // Exported globals (options)
  68. extern int                device_tree_skip_macos;            // Skip MacOS drivers
  69. extern int                device_tree_max_prop_length;    // Max copied property length
  70.  
  71. #pragma options align=reset
  72.  
  73. #endif